package cn.tedu.mybatisdemo.mapper;

import cn.tedu.mybatisdemo.pojo.Teacher;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;
//指定这是一个操作数据库的mapper
@Repository
public interface TeacherMapper {
    @Select("SELECT * FROM teacher")
    public List<Teacher> getTeacherAll();

    @Insert("INSERT INTO teacher VALUES (6666,'光头师傅',22,'宗师',null,100000,50000,'男',0);")
    public int addTeacher();

    @Update("UPDATE teacher SET salary = 1000 WHERE name = '光头师傅'")
    public int updateTeacher();

    @Delete("DELETE FROM teacher WHERE name = '光头师傅'")
    public int deleteTeacher();

}
